/***********************************
* Name: InterMethodCall.java
* Date: Oct 7, 2010
* @author martin
* Description:
***********************************/

package interCodeGen;


public class InterMethodCall implements Cod3Dir{

    String dir1 = "";   //id1 //temp1
    String dir2 = "";   //id2 //funcion
    String dir3 = "";   //id3 //parametros
    //si es void
    //call funcion, parametros
    //si no es void
    //temp1 = call funcion, parametros

    boolean void_type;

    /*****************************************
     * InterAsignacion
     * constructor
     *****************************************/
    public InterMethodCall(String dir1, String dir2, String dir3){
        this.dir1 = dir1;
        this.dir2 = dir2;
        this.dir3 = dir3;

        void_type = false;
    }

    /*****************************************
     * InterAsignacion
     * constructor
     *****************************************/
    public InterMethodCall(String dir2, String dir3){
        this.dir2 = dir2;
        this.dir3 = dir3;
        void_type = true;
    }

    /*****************************************
     * getId1
     * @return id1 with his representation
     *****************************************/
    public String getId1() {
        return this.dir1;
    }

    /*****************************************
     * getId2
     * @return id2 with his representation
     *****************************************/
    public String getId2() {
        return this.dir2;
    }

    /*****************************************
     * getId3
     * @return id3 with his representation
     *****************************************/
    public String getId3() {
        return this.dir3;
    }

    /*****************************************
     * getCodeString
     * @return the complete code of the Cod3Dir
     *****************************************/
    public String getCodeString() {
        if(void_type){
            return "\t"+"call "+this.dir2+", "+this.dir3;
        }
        return "\t"+this.dir1+" = call "+this.dir2+", "+this.dir3;
    }

}